Improve benchmark installation speed#2683
Conversation
|
Test failures look the same as those on |
This solves a problem noticed while installing benchmarks and watching htop. A significant amount of time per installation is wasted checking package version that have already been checked. This commit caches those versions.
22ab4a1 to
b97ab5a
Compare
|
@xmfan Please take a second look, I had to rewrite this after realizing this function is also used to validate that package versions haven't changed after installing benchmarks (which caching would invalidate). Currently getting some timing runs, but I still expect roughly the same speedup. |
|
On my machine, installing all benchmarks on The main reason for this is that we checked the version of several dependencies twice per benchmark. We got the version by importing the package in a new subprocess and querying |
|
@huydhn has imported this pull request. If you are a Meta employee, you can view this in D102056803. |
This solves a problem noticed while installing benchmarks and watching htop. A significant amount of time per installation is wasted spinning up new Python subprocesses to repeatedly import packages and check their versions. This wastes substantial time when the package import takes several second (as with
torch). This PR cuts down benchmark install time on my machine from 35 minutes to 12.I also fixed one or two minor Ruff lints in the files I touched.